import {get,post} from "@/api";
import {Chapter, Tollgate} from "@/ts/scheme";
import sysConfig from "@/config/index"
const baseURL="/client/chapter"
export function getChapterListPage(schemeId:string,pageNum:number){
    return get(baseURL,"/page",{
        current:pageNum,
        size:sysConfig.NO_PAGE_SIZE,
        schemeId:schemeId
    })
}

export function getChaptersWithTollgates(schemeId:string){
    return get(baseURL,"/list",{
        schemeId:schemeId
    })
}

export function getChapterById(chapterId:string){
    return get(baseURL,"/detail",{
        id:chapterId
    })
}

export function addChapter(chapter:Chapter){
    return post(baseURL,"/add",{
        ...chapter
    })
}export function updateChapter(chapter:Chapter){
    return post(baseURL,"/edit",{
        ...chapter
    })
}